package com.jzit.network

import com.jzit.network.intercept.ResponseLogInterceptor
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import retrofit2.CallAdapter
import retrofit2.Converter
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import java.util.ArrayList

/*
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
       Author   :  zhouxc
       Date     :  2022/10/26
       Time     :  14:40
    ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 */
open class DefaultNetWorkOption : INetworkOptions {
    override fun getHttpClient(): OkHttpClient? {
        return null
    }

    override fun addCallAdapterFactory(factories: ArrayList<CallAdapter.Factory>) {
        factories.add(RxJava2CallAdapterFactory.create())
    }

    override fun addConverterFactory(factories: ArrayList<Converter.Factory>) {
        factories.add(GsonConverterFactory.create())
    }

    override fun addInterceptor(interceptors: ArrayList<Interceptor>) {
        interceptors.add(ResponseLogInterceptor())
    }

    override fun addNetworkInterceptor(interceptors: ArrayList<Interceptor>) {

    }
}